package cn.han.controller;

import JDBC.Connect1;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "Servlet02",urlPatterns = "/han.do")
public class Servlet02 extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String[] usernames = request.getParameterValues("username");
        String[] passwords = request.getParameterValues("pwd");
//        System.out.println(passwords[0]);
//        System.out.println(usernames[0]);
        try {
            Connect1.SelValue(usernames[0],passwords[0]);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
